package InterfaceDos;

import java.awt.Font;
import java.awt.TextField;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import java.util.LinkedList;
import javax.swing.JTextField;

import View.viewAbout;
import View.viewDificultad;
import View.viewInfoSudoku;
import View.viewIntrucciones;
import View.viewSave;
import View.viewTopTen;
import Controller.Controller;
import InterfaceUno.viewOne;
        
/*
 * viewDos.java
 *
 * Created on Oct 18, 2012, 11:45:01 PM
 */
/**
 *
 * @author Administrator
 */
public final class viewDos extends javax.swing.JFrame {
    LinkedList<java.awt.TextField> ListtextField=new LinkedList();
    
    viewDificultad VD =new viewDificultad();
    viewTopTen VTT = new viewTopTen();
    Controller controller;

    /** Creates new form viewDos */
    public viewDos() {
        initComponents();
        setTexFieldInList();
        controller= new Controller();
        this.setVisible(true);
    }
   
    public String getDificultad(){
        return VD.getDificultad();
    }
        
    public void setTable(JTable a){
        VTT.setTable(a);
    }
    public void setTexFieldInList(){
       ListtextField.add(celda1);
       ListtextField.add(celda2);
       ListtextField.add(celda3);
       ListtextField.add(celda4);
       ListtextField.add(celda5);
       ListtextField.add(celda6);
       ListtextField.add(celda7);
       ListtextField.add(celda8);
       ListtextField.add(celda9);
       ListtextField.add(celda10);
       ListtextField.add(celda11);
       ListtextField.add(celda12);
       ListtextField.add(celda13);
       ListtextField.add(celda14);
       ListtextField.add(celda15);
       ListtextField.add(celda16);
       ListtextField.add(celda17);
       ListtextField.add(celda18);
       ListtextField.add(celda19);
       ListtextField.add(celda20);
       ListtextField.add(celda21);
       ListtextField.add(celda22);
       ListtextField.add(celda23);
       ListtextField.add(celda24);
       ListtextField.add(celda25);
       ListtextField.add(celda26);
       ListtextField.add(celda27);
       ListtextField.add(celda28);
       ListtextField.add(celda29);
       ListtextField.add(celda30);
       ListtextField.add(celda31);
       ListtextField.add(celda32);
       ListtextField.add(celda33);
       ListtextField.add(celda34);
       ListtextField.add(celda35);
       ListtextField.add(celda36);
       ListtextField.add(celda37);
       ListtextField.add(celda38);
       ListtextField.add(celda39);
       ListtextField.add(celda40);
       ListtextField.add(celda41);
       ListtextField.add(celda42);
       ListtextField.add(celda43);
       ListtextField.add(celda44);
       ListtextField.add(celda45);
       ListtextField.add(celda46);
       ListtextField.add(celda47);
       ListtextField.add(celda48);
       ListtextField.add(celda49);
       ListtextField.add(celda50);
       ListtextField.add(celda51);
       ListtextField.add(celda52);
       ListtextField.add(celda53);
       ListtextField.add(celda54);
       ListtextField.add(celda55);
       ListtextField.add(celda56);
       ListtextField.add(celda57);
       ListtextField.add(celda58);
       ListtextField.add(celda59);
       ListtextField.add(celda60);
       ListtextField.add(celda61);
       ListtextField.add(celda62);
       ListtextField.add(celda63);
       ListtextField.add(celda64);
       ListtextField.add(celda65);
       ListtextField.add(celda66);
       ListtextField.add(celda67);
       ListtextField.add(celda68);
       ListtextField.add(celda69);
       ListtextField.add(celda70);
       ListtextField.add(celda71);
       ListtextField.add(celda72);
       ListtextField.add(celda73);
       ListtextField.add(celda74);
       ListtextField.add(celda75);
       ListtextField.add(celda76);
       ListtextField.add(celda77);
       ListtextField.add(celda78);
       ListtextField.add(celda79);
       ListtextField.add(celda80);
       ListtextField.add(celda81);
    }

    public void setImagePanel(){
        
                
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        celda10 = new java.awt.TextField();
        celda1 = new java.awt.TextField();
        celda11 = new java.awt.TextField();
        celda2 = new java.awt.TextField();
        celda4 = new java.awt.TextField();
        celda13 = new java.awt.TextField();
        celda12 = new java.awt.TextField();
        celda3 = new java.awt.TextField();
        celda14 = new java.awt.TextField();
        celda5 = new java.awt.TextField();
        celda6 = new java.awt.TextField();
        celda15 = new java.awt.TextField();
        celda16 = new java.awt.TextField();
        celda7 = new java.awt.TextField();
        celda8 = new java.awt.TextField();
        celda9 = new java.awt.TextField();
        celda18 = new java.awt.TextField();
        celda17 = new java.awt.TextField();
        celda27 = new java.awt.TextField();
        celda36 = new java.awt.TextField();
        celda35 = new java.awt.TextField();
        celda26 = new java.awt.TextField();
        celda25 = new java.awt.TextField();
        celda34 = new java.awt.TextField();
        celda33 = new java.awt.TextField();
        celda24 = new java.awt.TextField();
        celda23 = new java.awt.TextField();
        celda32 = new java.awt.TextField();
        celda22 = new java.awt.TextField();
        celda31 = new java.awt.TextField();
        celda21 = new java.awt.TextField();
        celda20 = new java.awt.TextField();
        celda19 = new java.awt.TextField();
        celda28 = new java.awt.TextField();
        celda29 = new java.awt.TextField();
        celda30 = new java.awt.TextField();
        celda54 = new java.awt.TextField();
        celda45 = new java.awt.TextField();
        celda44 = new java.awt.TextField();
        celda53 = new java.awt.TextField();
        celda43 = new java.awt.TextField();
        celda52 = new java.awt.TextField();
        celda42 = new java.awt.TextField();
        celda51 = new java.awt.TextField();
        celda41 = new java.awt.TextField();
        celda50 = new java.awt.TextField();
        celda40 = new java.awt.TextField();
        celda49 = new java.awt.TextField();
        celda39 = new java.awt.TextField();
        celda48 = new java.awt.TextField();
        celda38 = new java.awt.TextField();
        celda47 = new java.awt.TextField();
        celda46 = new java.awt.TextField();
        celda37 = new java.awt.TextField();
        celda63 = new java.awt.TextField();
        celda62 = new java.awt.TextField();
        celda61 = new java.awt.TextField();
        celda60 = new java.awt.TextField();
        celda59 = new java.awt.TextField();
        celda58 = new java.awt.TextField();
        celda57 = new java.awt.TextField();
        celda56 = new java.awt.TextField();
        celda55 = new java.awt.TextField();
        celda72 = new java.awt.TextField();
        celda71 = new java.awt.TextField();
        celda70 = new java.awt.TextField();
        celda69 = new java.awt.TextField();
        celda68 = new java.awt.TextField();
        celda67 = new java.awt.TextField();
        celda66 = new java.awt.TextField();
        celda65 = new java.awt.TextField();
        celda64 = new java.awt.TextField();
        celda73 = new java.awt.TextField();
        celda74 = new java.awt.TextField();
        celda75 = new java.awt.TextField();
        celda76 = new java.awt.TextField();
        celda77 = new java.awt.TextField();
        celda78 = new java.awt.TextField();
        celda79 = new java.awt.TextField();
        celda80 = new java.awt.TextField();
        celda81 = new java.awt.TextField();
        cambioInterfaz = new javax.swing.JButton();
        termine = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        sugerirJugada = new javax.swing.JButton();
        verificar = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        guardarPartida = new javax.swing.JButton();
        reiniciarPartida = new javax.swing.JButton();
        nuevaPartida = new javax.swing.JButton();
        resolverPartida = new javax.swing.JButton();
        cargarPartida = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        nivelDificultad = new javax.swing.JButton();
        intrucciones = new javax.swing.JButton();
        infoSudoku = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        archivo = new javax.swing.JMenu();
        jMenuItem3 = new javax.swing.JMenuItem();
        S = new javax.swing.JMenuItem();
        informacion = new javax.swing.JMenu();
        jMenuItem2 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Sudokus");
        setAlwaysOnTop(true);
        setBackground(new java.awt.Color(255, 255, 255));
        setResizable(false);

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
        jPanel1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        celda10.setBackground(new java.awt.Color(174, 174, 249));

        celda1.setBackground(new java.awt.Color(174, 174, 249));

        celda11.setBackground(new java.awt.Color(174, 174, 249));

        celda2.setBackground(new java.awt.Color(174, 174, 249));

        celda4.setBackground(new java.awt.Color(161, 227, 93));

        celda13.setBackground(new java.awt.Color(161, 227, 93));

        celda12.setBackground(new java.awt.Color(174, 174, 249));

        celda3.setBackground(new java.awt.Color(174, 174, 249));

        celda14.setBackground(new java.awt.Color(161, 227, 93));

        celda5.setBackground(new java.awt.Color(161, 227, 93));

        celda6.setBackground(new java.awt.Color(161, 227, 93));

        celda15.setBackground(new java.awt.Color(161, 227, 93));

        celda16.setBackground(new java.awt.Color(174, 174, 249));

        celda7.setBackground(new java.awt.Color(174, 174, 249));

        celda8.setBackground(new java.awt.Color(174, 174, 249));

        celda9.setBackground(new java.awt.Color(174, 174, 249));

        celda18.setBackground(new java.awt.Color(174, 174, 249));

        celda17.setBackground(new java.awt.Color(174, 174, 249));

        celda27.setBackground(new java.awt.Color(174, 174, 249));

        celda36.setBackground(new java.awt.Color(161, 227, 93));

        celda35.setBackground(new java.awt.Color(161, 227, 93));

        celda26.setBackground(new java.awt.Color(174, 174, 249));

        celda25.setBackground(new java.awt.Color(174, 174, 249));

        celda34.setBackground(new java.awt.Color(161, 227, 93));

        celda33.setBackground(new java.awt.Color(174, 174, 249));

        celda24.setBackground(new java.awt.Color(161, 227, 93));

        celda23.setBackground(new java.awt.Color(161, 227, 93));
        celda23.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                actionPerformed(evt);
                //celda23ActionPerformed(evt);

            }
        });

        celda32.setBackground(new java.awt.Color(174, 174, 249));

        celda22.setBackground(new java.awt.Color(161, 227, 93));

        celda31.setBackground(new java.awt.Color(174, 174, 249));

        celda21.setBackground(new java.awt.Color(174, 174, 249));

        celda20.setBackground(new java.awt.Color(174, 174, 249));

        celda19.setBackground(new java.awt.Color(174, 174, 249));

        celda28.setBackground(new java.awt.Color(161, 227, 93));

        celda29.setBackground(new java.awt.Color(161, 227, 93));

        celda30.setBackground(new java.awt.Color(161, 227, 93));

        celda54.setBackground(new java.awt.Color(161, 227, 93));

        celda45.setBackground(new java.awt.Color(161, 227, 93));

        celda44.setBackground(new java.awt.Color(161, 227, 93));

        celda53.setBackground(new java.awt.Color(161, 227, 93));

        celda43.setBackground(new java.awt.Color(161, 227, 93));

        celda52.setBackground(new java.awt.Color(161, 227, 93));

        celda42.setBackground(new java.awt.Color(174, 174, 249));

        celda51.setBackground(new java.awt.Color(174, 174, 249));

        celda41.setBackground(new java.awt.Color(174, 174, 249));

        celda50.setBackground(new java.awt.Color(174, 174, 249));

        celda40.setBackground(new java.awt.Color(174, 174, 249));

        celda49.setBackground(new java.awt.Color(174, 174, 249));

        celda39.setBackground(new java.awt.Color(161, 227, 93));

        celda48.setBackground(new java.awt.Color(161, 227, 93));

        celda38.setBackground(new java.awt.Color(161, 227, 93));

        celda47.setBackground(new java.awt.Color(161, 227, 93));

        celda46.setBackground(new java.awt.Color(161, 227, 93));

        celda37.setBackground(new java.awt.Color(161, 227, 93));

        celda63.setBackground(new java.awt.Color(174, 174, 249));

        celda62.setBackground(new java.awt.Color(174, 174, 249));

        celda61.setBackground(new java.awt.Color(174, 174, 249));

        celda60.setBackground(new java.awt.Color(161, 227, 93));
        celda60.setEditable(false);

        celda59.setBackground(new java.awt.Color(161, 227, 93));
        celda59.setEditable(false);

        celda58.setBackground(new java.awt.Color(161, 227, 93));
        celda58.setEditable(false);

        celda57.setBackground(new java.awt.Color(174, 174, 249));

        celda56.setBackground(new java.awt.Color(174, 174, 249));

        celda55.setBackground(new java.awt.Color(174, 174, 249));

        celda72.setBackground(new java.awt.Color(174, 174, 249));

        celda71.setBackground(new java.awt.Color(174, 174, 249));

        celda70.setBackground(new java.awt.Color(174, 174, 249));

        celda69.setBackground(new java.awt.Color(161, 227, 93));
        celda69.setEditable(false);

        celda68.setBackground(new java.awt.Color(161, 227, 93));
        celda68.setEditable(false);

        celda67.setBackground(new java.awt.Color(161, 227, 93));
        celda67.setEditable(false);

        celda66.setBackground(new java.awt.Color(174, 174, 249));

        celda65.setBackground(new java.awt.Color(174, 174, 249));

        celda64.setBackground(new java.awt.Color(174, 174, 249));

        celda73.setBackground(new java.awt.Color(174, 174, 249));

        celda74.setBackground(new java.awt.Color(174, 174, 249));

        celda75.setBackground(new java.awt.Color(174, 174, 249));

        celda76.setBackground(new java.awt.Color(161, 227, 93));
        celda76.setEditable(false);

        celda77.setBackground(new java.awt.Color(161, 227, 93));
        celda77.setEditable(false);

        celda78.setBackground(new java.awt.Color(161, 227, 93));
        celda78.setEditable(false);

        celda79.setBackground(new java.awt.Color(174, 174, 249));

        celda80.setBackground(new java.awt.Color(174, 174, 249));

        celda81.setBackground(new java.awt.Color(174, 174, 249));

        cambioInterfaz.setText("Cambiar Interfaz");
        cambioInterfaz.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cambiarInterfazActionPerformed(evt);
            }
        });

        termine.setText("Termine???");
        termine.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                termineActionPerformed(evt);
            }
        });

        jLabel2.setText("(Opcion para comprobar si ha finalizado el juego)");

        sugerirJugada.setText("Sugerir Jugada");
        sugerirJugada.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                sugerirJugadaActionPerformed(evt);
            }
        });

        verificar.setText("Verificar");
        verificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                verificarActionPerformed(evt);
            }
        });

        jPanel2.setBackground(new java.awt.Color(255, 255, 255));
        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Opciones", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 14))); // NOI18N

        guardarPartida.setText("Guardar Partida");
        guardarPartida.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
            	GPActionPerformed(evt);
            }
        });


        reiniciarPartida.setText("Reiniciar Partida");
        reiniciarPartida.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                reiniciarPartidaActionPerformed(evt);
            }
        });

        nuevaPartida.setText("Nueva Partida");
        nuevaPartida.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nuevaPartidaActionPerformed(evt);
            }
        });

        resolverPartida.setText("Resolver Partida");
        resolverPartida.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                resolverPartidaActionPerformed(evt);
            }
        });

        cargarPartida.setText("Cargar Partida");
        cargarPartida.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cargarPartidaActionPerformed(evt);
            }
        });
        

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(guardarPartida, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(reiniciarPartida, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(resolverPartida, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(cargarPartida, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(nuevaPartida, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(19, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(nuevaPartida)
                .addGap(18, 18, 18)
                .addComponent(guardarPartida)
                .addGap(18, 18, 18)
                .addComponent(cargarPartida)
                .addGap(18, 18, 18)
                .addComponent(resolverPartida)
                .addGap(18, 18, 18)
                .addComponent(reiniciarPartida)
                .addContainerGap(24, Short.MAX_VALUE))
        );

        jPanel3.setBackground(new java.awt.Color(255, 255, 255));
        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Extras", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 14))); // NOI18N

        nivelDificultad.setText("Nivel Dificultad");
        nivelDificultad.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nivelDificultadActionPerformed(evt);
            }
        });

       // intrucciones.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, java.awt.event.InputEvent.CTRL_MASK));
        intrucciones.setText("Intrucciones");
        intrucciones.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                IntActionPerformed(evt);
            }
        });
        
      //  infoSudoku.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
        infoSudoku.setText("Informacion del Sudoku");
        infoSudoku.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
            	infoSudokuActionPerformed(evt);
            }
        });
        
        jMenuItem3.setText("Top Ten");
        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
            	topTenActionPerformed(evt);
            }
        });
        archivo.add(jMenuItem3);
        
        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(nivelDificultad, javax.swing.GroupLayout.PREFERRED_SIZE, 107, Short.MAX_VALUE)
                    .addComponent(intrucciones, javax.swing.GroupLayout.DEFAULT_SIZE, 107, Short.MAX_VALUE)
                    .addComponent(infoSudoku, javax.swing.GroupLayout.DEFAULT_SIZE, 107, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(infoSudoku)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 70, Short.MAX_VALUE)
                .addComponent(intrucciones)
                .addGap(61, 61, 61)
                .addComponent(nivelDificultad)
                .addGap(22, 22, 22))
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(celda73, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(2, 2, 2)
                        .addComponent(celda74, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(1, 1, 1)
                        .addComponent(celda75, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(2, 2, 2)
                        .addComponent(celda76, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(2, 2, 2)
                        .addComponent(celda77, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(2, 2, 2)
                        .addComponent(celda78, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(1, 1, 1)
                        .addComponent(celda79, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(2, 2, 2)
                        .addComponent(celda80, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(2, 2, 2)
                        .addComponent(celda81, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda19, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda28, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(2, 2, 2)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda20, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda29, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(1, 1, 1)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda21, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda30, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(2, 2, 2)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda22, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda31, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(2, 2, 2)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda23, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda32, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(2, 2, 2)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda24, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda33, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(1, 1, 1)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda25, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda34, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(2, 2, 2)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda26, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda35, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(2, 2, 2)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda36, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda27, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda37, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda46, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(2, 2, 2)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda38, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda47, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(1, 1, 1)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda39, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda48, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(2, 2, 2)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda40, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda49, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(2, 2, 2)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda41, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda50, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(2, 2, 2)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda42, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda51, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(1, 1, 1)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda43, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda52, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(2, 2, 2)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda44, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda53, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(2, 2, 2)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda54, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda45, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(celda1, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(celda10, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGap(2, 2, 2)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(celda2, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(celda11, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGap(1, 1, 1)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(celda3, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(celda12, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGap(2, 2, 2)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(celda4, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(celda13, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addComponent(cambioInterfaz))
                                .addGap(2, 2, 2)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda5, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda14, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(2, 2, 2)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(celda6, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(celda15, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGap(1, 1, 1)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(celda7, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(celda16, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGap(2, 2, 2)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(celda8, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(celda17, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGap(2, 2, 2)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(celda18, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(celda9, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addComponent(sugerirJugada)))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(celda55, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(2, 2, 2)
                                .addComponent(celda56, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(1, 1, 1)
                                .addComponent(celda57, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(2, 2, 2)
                                .addComponent(celda58, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(2, 2, 2)
                                .addComponent(celda59, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(2, 2, 2)
                                .addComponent(celda60, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(1, 1, 1)
                                .addComponent(celda61, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(2, 2, 2)
                                .addComponent(celda62, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(2, 2, 2)
                                .addComponent(celda63, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(celda64, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(2, 2, 2)
                        .addComponent(celda65, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(1, 1, 1)
                        .addComponent(celda66, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(2, 2, 2)
                        .addComponent(celda67, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(2, 2, 2)
                        .addComponent(celda68, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(2, 2, 2)
                        .addComponent(celda69, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(1, 1, 1)
                        .addComponent(celda70, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(2, 2, 2)
                        .addComponent(celda71, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(2, 2, 2)
                        .addComponent(celda72, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel2)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(termine)
                                .addGap(54, 54, 54)))
                        .addGap(17, 17, 17)
                        .addComponent(verificar, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(107, 107, 107)
                .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(259, 259, 259))
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(22, 22, 22)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cambioInterfaz, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(sugerirJugada, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(19, 19, 19)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(celda8, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)
                                        .addComponent(celda17, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(celda9, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)
                                        .addComponent(celda18, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addComponent(celda7, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(1, 1, 1)
                                    .addComponent(celda16, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(celda6, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)
                                        .addComponent(celda15, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(celda5, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)
                                        .addComponent(celda14, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(celda4, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)
                                        .addComponent(celda13, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(celda3, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)
                                        .addComponent(celda12, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(celda2, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)
                                        .addComponent(celda11, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(celda1, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)
                                        .addComponent(celda10, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                        .addGap(1, 1, 1)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(celda26, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)
                                        .addComponent(celda35, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(celda27, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)
                                        .addComponent(celda36, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addComponent(celda25, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(1, 1, 1)
                                    .addComponent(celda34, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(celda24, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)
                                        .addComponent(celda33, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(celda23, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)
                                        .addComponent(celda32, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(celda22, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)
                                        .addComponent(celda31, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(celda21, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)
                                        .addComponent(celda30, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(celda20, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)
                                        .addComponent(celda29, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(celda19, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)
                                        .addComponent(celda28, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                        .addGap(1, 1, 1)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(celda44, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)
                                        .addComponent(celda53, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(celda45, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)
                                        .addComponent(celda54, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addComponent(celda43, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(1, 1, 1)
                                    .addComponent(celda52, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(celda42, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)
                                        .addComponent(celda51, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(celda41, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)
                                        .addComponent(celda50, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(celda40, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)
                                        .addComponent(celda49, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(celda39, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)
                                        .addComponent(celda48, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(celda38, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)
                                        .addComponent(celda47, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(celda37, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)
                                        .addComponent(celda46, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                        .addGap(1, 1, 1)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda63, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda62, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addComponent(celda61, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda60, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda59, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda58, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda57, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda56, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda55, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGap(1, 1, 1)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda72, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda71, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addComponent(celda70, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda69, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda68, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda67, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda66, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda65, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda64, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGap(1, 1, 1)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda81, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda80, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addComponent(celda79, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda78, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda77, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda76, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda75, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(celda74, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(celda73, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGap(25, 25, 25)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(termine, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(verificar, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel2))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(106, 106, 106)
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );

        archivo.setText("Archivo");

        jMenuItem3.setText("Top Ten");
        archivo.add(jMenuItem3);

        S.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W, java.awt.event.InputEvent.CTRL_MASK));
        S.setText("Salir");
        S.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SActionPerformed(evt);
            }
        });
        archivo.add(S);

        jMenuBar1.add(archivo);

        informacion.setText("Informacion");
        informacion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                informacionActionPerformed(evt);
            }
        });

        jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem2.setText("About Sudoku");
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        informacion.add(jMenuItem2);

        jMenuBar1.add(informacion);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void NPActionPerformed(java.awt.event.ActionEvent evt) {                                   
// TODO add your handling code here:
}                                  

private void SActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SActionPerformed
    dispose();// TODO add your handling code here:
}//GEN-LAST:event_SActionPerformed

private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
    viewAbout VA =new viewAbout();
    VA.setVisible(true);
}//GEN-LAST:event_jMenuItem2ActionPerformed

private void informacionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_informacionActionPerformed
    VTT.setVisible(true);
}//GEN-LAST:event_informacionActionPerformed

private void nuevaPartidaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nuevaPartidaActionPerformed
	setTablero(controller.nuevoJuego(getDificultad()));
}//GEN-LAST:event_nuevaPartidaActionPerformed

private void nivelDificultadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nivelDificultadActionPerformed
    VD.setVisible(true);
    System.out.println(getDificultad());}//GEN-LAST:event_nivelDificultadActionPerformed

private void sugerirJugadaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sugerirJugadaActionPerformed
	setTablero(controller.sugerirJugada(getTablero()));
}//GEN-LAST:event_sugerirJugadaActionPerformed

private void cambiarInterfazActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cambiarInterfazActionPerformed
		int[] array = controller.compobar(getTablero());
		if (array[0]==0)
			JOptionPane.showMessageDialog(this, "La posicin ("+array[1]+","+array[2]+") "+"esta mal, no se " +
												"puede cambiar de interfaz.", "",JOptionPane.WARNING_MESSAGE);
		else{
			viewOne vista1 = new viewOne();
			vista1.setTablero(getTablero());
			vista1.setController(controller);
			this.setVisible(false);
			vista1.setVisible(true);
		}
	}//GEN-LAST:event_cambiarInterfazActionPerformed}//GEN-LAST:event_cambioInterfazActionPerformed

private void termineActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_termineActionPerformed
	int[] array = controller.compobar(getTablero());
	if (array[0]==0)
		JOptionPane.showMessageDialog(this, "La posicin ("+array[1]+","+array[2]+") "+"esta mal.", "",JOptionPane.WARNING_MESSAGE);
	else{
		controller.terminoTiempo();
		viewSave view = new viewSave(controller);
		view.setVisible(true);
	}
}//GEN-LAST:event_termineActionPerformed

private void verificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_verificarActionPerformed
	int[] array = controller.compobar(getTablero());
	if (array[0]==0)
		JOptionPane.showMessageDialog(this, "La posicion ("+array[1]+","+array[2]+") "+"esta mal.", "",JOptionPane.WARNING_MESSAGE);
	else
		JOptionPane.showMessageDialog(this,"No hay posiciones erroneas.", "",JOptionPane.WARNING_MESSAGE);	
}//GEN-LAST:event_verificarActionPerformed

private void reiniciarPartidaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reiniciarPartidaActionPerformed
	setTablero(controller.restart());
}//GEN-LAST:event_reiniciarPartidaActionPerformed

private void resolverPartidaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_resolverPartidaActionPerformed
	setTablero(controller.resolver());
}//GEN-LAST:event_resolverPartidaActionPerformed

private void cargarPartidaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cargarPartidaActionPerformed
	setTablero(controller.cargar());
}//GEN-LAST:event_cargarPartidaActionPerformed

private void GPActionPerformed(java.awt.event.ActionEvent evt) {
	controller.guardarPartida(getTablero());
	JOptionPane.showMessageDialog(this, "La partida se ha guardado correctamente.", "",JOptionPane.WARNING_MESSAGE);
}


private void IntActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_IntActionPerformed
    viewIntrucciones VI= new viewIntrucciones();
    VI.setVisible(true);
}//GEN-LAST:event_IntActionPerformed

private void infoSudokuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ISActionPerformed
    viewInfoSudoku VIS =new viewInfoSudoku();
    VIS.setVisible(true);
}

private void topTenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TTActionPerformed
	viewTopTen view = new viewTopTen();
	view.setTable(controller.topTen());
	view.setVisible(true);
}//GEN-LAST:event_TTActionPerformed


public void setController(Controller cont){
	controller = cont;
}

public String[][] getTablero(){
	String[][] m = new String[9][9];
	int cont = 0;  
	for (int f=0; f<9; f++){
        for (int c=0; c<9; c++){
        	if (ListtextField.get(cont).getText().compareTo(" ")!=0){
        		m[f][c] = ListtextField.get(cont).getText().trim();
           	} else
           		m[f][c] = "0";
        	cont++;
        }
	}
	return m;
}


public void setTablero(String[][] matriz){
	//Semilla
	Font font1 = new Font("Verdana", Font.BOLD, 30);
	//noSemilla
	Font font2 = new Font("Verdana", Font.PLAIN, 31);

	int cont = 0;
	TextField asd;
	for(int i=0;i<9;i++){
		for(int j=0;j<9;j++){
			if ((matriz[i][j])!="0"){
				asd = ListtextField.get(cont);
				asd.setFont(font1);
				asd.setText(matriz[i][j]);
				asd.setEditable(false);
				ListtextField.set(cont,asd);
			}else{
				asd = ListtextField.get(cont);
				asd.setFont(font2);
				asd.setText(" ");
				asd.setEditable(true);
			}
			cont++;
		}
	}
}

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuItem S;
    private javax.swing.JMenu archivo;
    private javax.swing.JButton cambioInterfaz;
    private javax.swing.JButton cargarPartida;
    private java.awt.TextField celda1;
    private java.awt.TextField celda10;
    private java.awt.TextField celda11;
    private java.awt.TextField celda12;
    private java.awt.TextField celda13;
    private java.awt.TextField celda14;
    private java.awt.TextField celda15;
    private java.awt.TextField celda16;
    private java.awt.TextField celda17;
    private java.awt.TextField celda18;
    private java.awt.TextField celda19;
    private java.awt.TextField celda2;
    private java.awt.TextField celda20;
    private java.awt.TextField celda21;
    private java.awt.TextField celda22;
    private java.awt.TextField celda23;
    private java.awt.TextField celda24;
    private java.awt.TextField celda25;
    private java.awt.TextField celda26;
    private java.awt.TextField celda27;
    private java.awt.TextField celda28;
    private java.awt.TextField celda29;
    private java.awt.TextField celda3;
    private java.awt.TextField celda30;
    private java.awt.TextField celda31;
    private java.awt.TextField celda32;
    private java.awt.TextField celda33;
    private java.awt.TextField celda34;
    private java.awt.TextField celda35;
    private java.awt.TextField celda36;
    private java.awt.TextField celda37;
    private java.awt.TextField celda38;
    private java.awt.TextField celda39;
    private java.awt.TextField celda4;
    private java.awt.TextField celda40;
    private java.awt.TextField celda41;
    private java.awt.TextField celda42;
    private java.awt.TextField celda43;
    private java.awt.TextField celda44;
    private java.awt.TextField celda45;
    private java.awt.TextField celda46;
    private java.awt.TextField celda47;
    private java.awt.TextField celda48;
    private java.awt.TextField celda49;
    private java.awt.TextField celda5;
    private java.awt.TextField celda50;
    private java.awt.TextField celda51;
    private java.awt.TextField celda52;
    private java.awt.TextField celda53;
    private java.awt.TextField celda54;
    private java.awt.TextField celda55;
    private java.awt.TextField celda56;
    private java.awt.TextField celda57;
    private java.awt.TextField celda58;
    private java.awt.TextField celda59;
    private java.awt.TextField celda6;
    private java.awt.TextField celda60;
    private java.awt.TextField celda61;
    private java.awt.TextField celda62;
    private java.awt.TextField celda63;
    private java.awt.TextField celda64;
    private java.awt.TextField celda65;
    private java.awt.TextField celda66;
    private java.awt.TextField celda67;
    private java.awt.TextField celda68;
    private java.awt.TextField celda69;
    private java.awt.TextField celda7;
    private java.awt.TextField celda70;
    private java.awt.TextField celda71;
    private java.awt.TextField celda72;
    private java.awt.TextField celda73;
    private java.awt.TextField celda74;
    private java.awt.TextField celda75;
    private java.awt.TextField celda76;
    private java.awt.TextField celda77;
    private java.awt.TextField celda78;
    private java.awt.TextField celda79;
    private java.awt.TextField celda8;
    private java.awt.TextField celda80;
    private java.awt.TextField celda81;
    private java.awt.TextField celda9;
    private javax.swing.JButton guardarPartida;
    private javax.swing.JButton infoSudoku;
    private javax.swing.JMenu informacion;
    private javax.swing.JButton intrucciones;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JButton nivelDificultad;
    private javax.swing.JButton nuevaPartida;
    private javax.swing.JButton reiniciarPartida;
    private javax.swing.JButton resolverPartida;
    private javax.swing.JButton sugerirJugada;
    private javax.swing.JButton termine;
    private javax.swing.JButton verificar;
    // End of variables declaration//GEN-END:variables
}
